The content language object has a cache for namespaces, it might then
not take in account $wgExtraNamespaces set by the parser test suite
which causes unknown namespaces errors.
Ensure the new language object has a clean cache.
Repro:
php phpunit.php --filter '(ParserMethodsTest::testValidCovers|T53680)'
Bug: T190554
Change-Id: I9c4104d7bb3a0c84b60d7e7b4154743cbe58348c
// Set content language. This invalidates the magic word cache and title services
$lang = Language::factory( $langCode );
+ $lang->resetNamespaces();
$setup['wgContLang'] = $lang;
$reset = function () {
MagicWord::clearCache();